package com.n1global.serveranalytics;

import java.util.Calendar;

import com.n1global.acc.json.CouchDbDocument;

public class LogMessage extends CouchDbDocument {
    private long summedValue;

    private Object payload;

    private Object[] fields;

    private Integer[] date;

    public LogMessage() {
        // empty
    }

    public LogMessage(long summedValue, Object payload, String[] fields) {
        this.summedValue = summedValue;
        this.payload = payload;
        this.fields = fields;

        Calendar cal = Calendar.getInstance();

        date = new Integer[] {cal.get(Calendar.YEAR), (cal.get(Calendar.MONTH) + 1), cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE)};
    }

    public long getSummedValue() {
        return summedValue;
    }

    public Object getPayload() {
        return payload;
    }

    public Object[] getFields() {
        return fields;
    }

    public Integer[] getDate() {
        return date;
    }
}
